import request from '@/utils/request'

// 获取网络设备
export function fetchList(query) {
  return request({
    url: '/api/networkDevice/list',
    method: 'get',
    params: query
  })
}

// 新增网络设备
export function create(data) {
  return request({
    url: '/api/networkDevice/insert',
    method: 'post',
    data
  })
}

// 获取机房——机柜
export function fetchRackOptions(query) {
  return request({
    url: '/api/rack/queryRackOptions',
    method: 'get',
    params: query
  })
}

// 更新网络设备数据
export function update(data) {
  return request({
    url: '/api/networkDevice/update',
    method: 'put',
    data
  })
}

// 删除网络设备数据
export function del(data) {
  return request({
    url: '/api/networkDevice/delete',
    method: 'delete',
    data
  })
}
